package com.java.lambda.model;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;//用于后期的去重使用
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
public class Author implements Comparable<Author>{
    private Long id;
    private String name;
    private Integer age;
    //简介
    private String intro;
    private List<Book> books;
    
    @Override
    public int compareTo(Author o) {
        return o.getAge()-this.getAge();
    }
}
